package com.demo.usermanager.service;

import com.demo.usermanager.mapper.UserMapper;
import com.demo.usermanager.model.UserInfo;
import org.apache.catalina.User;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class UserService {
    @Resource
    private UserMapper userMapper;

    public UserInfo login(String loginname, String password) {
        return userMapper.login(loginname, password);
    }

    public List<UserInfo> getAll(){
        return userMapper.getAll();
    }

    public int add(UserInfo userInfo){
        return userMapper.add(userInfo);
    }

    public int update(UserInfo userInfo){
        return userMapper.update(userInfo);
    }

    public UserInfo getUserByLoginName(String loginname){
        return userMapper.getUserByLoginName(loginname);
    }

    public UserInfo getUserByUid(Integer uid){
        return userMapper.getUserByUid(uid);
    }
}
